﻿Option Strict On
Imports Microsoft.Win32

''' <summary>
''' Implement of Sims 3
''' </summary>
''' <remarks></remarks>
Public Class TS3Registry

    ''' <summary>
    ''' The list of all installed packs, preclude base and other developing tools
    ''' </summary>
    ''' <returns>List of TS3Key</returns>
    ''' <remarks></remarks>
    Public Shared Function GetPackRegistrykey() As IList(Of TS3Key)
        Dim _List As New List(Of TS3Key)
        For Each Name As String In Registry.LocalMachine.OpenSubKey("SOFTWARE\Sims", RegistryKeyPermissionCheck.ReadSubTree).GetSubKeyNames
            If (Name.Contains("Create") = False) AndAlso (Name <> "The Sims 3") Then

                _List.Add(New TS3Key(Name))
            End If
        Next
        Return _List
    End Function

    ''' <summary>
    ''' Gets the install dir of base game
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Shared ReadOnly Property Sims3InstallDir As String
        Get
            Dim Sims3Key As RegistryKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Sims\The Sims 3", False)
            Dim strPath As String = CStr(Sims3Key.GetValue("Install Dir"))
            Return strPath
        End Get
    End Property


End Class

